End

stops execution of a program and puts the PIC to sleep until reset or watchdog timeout.

The assembly language sleep instruction does for a PIC what the End instruction does for the BASIC Stamp; it shuts down the clock oscillator, halting program execution and reducing current draw to a few microamperes. If the PIC's watchdog timer is disabled (by a _wdt_off switch in the _config directive), that's it until the PIC is reset.

However, if the watchdog timer is on, the PIC will reawaken at the next timeout. If you want a watchdog-protected PIC to stay asleep, you must include code that checks the timeout and power-down bits (to and pd) for 00 and immediately puts the PIC back to sleep. See the section on the Sleep instruction for more information.

See also:

See: